<?php
/**
 * 错误码统一维护
 */

namespace app\util;

class ReturnCode {

    const SUCCESS = 1;
    const INVALID = -1;
    const DB_SAVE_ERROR = -2;
    const DB_READ_ERROR = -3;
    const CACHE_SAVE_ERROR = -4;
    const CACHE_READ_ERROR = -5;
    const FILE_SAVE_ERROR = -6;
    const LOGIN_ERROR = -7;
    const NOT_EXISTS = -8;
    const JSON_PARSE_FAIL = -9;
    const TYPE_ERROR = -10;
    const NUMBER_MATCH_ERROR = -11;
    const EMPTY_PARAMS = -12;
    const DATA_EXISTS = -13;
    const AUTH_ERROR = -14;

    const OTHER_LOGIN = -16;
    const VERSION_INVALID = -17;

    const CURL_ERROR = -18;

    const RECORD_NOT_FOUND = -19; // 记录未找到
    const DELETE_FAILED = -20; // 删除失败
    const ADD_FAILED = -21; // 添加记录失败
    const UPDATE_FAILED = -22; // 更新记录失败

    const SMS_ERROR = -23;//短信发送异常
    const PLACE_ORDER_ERROR = -24;//下单错误

    const PAMENT_ORDER_ERROR = -25;//订单支付错误

    const PASSWORD_FORBIDDEN = -43;//支付密码次数过多冻结

    const PLACE_RRCHARGE_ORDER_ERROR = -26;//订单支付错误

    const REFUND_ORDER_ERROR = -27;//订单退款错误

    const  ORDER_STATUS_ERROR = -28 ;  //删除订单状态错误

    const VERSION = -29;  //设备类型错误

    const UPLOAD_ERROR = -30;//文件上传错误

    const NO_LOGIN = -31;//未登录
    const USER_STATUS_ERROR = -32;//账号状态错误

    const FROST_ERROR = -33;//解绑操作错误

    const PAY_PASSWORD_ERROR = -34;//支付操作错误

    const ADD_ORDER_ERROR = -35;//添加订单错误
    const UNFREEZE_ERROR = -36;//冻结操作错误

    const UPFDATE_VERSION = 37;//需要更新版本
    const VER_ERROR = -39;//核销失败
    const NO_PAYPASSWORD_ERROR = -40;//未设置支付密码
    const ACTIVITY_ERROR = -41;//未设置支付密码
    const NO_OPENID = -42;//未设置支付密码

    const PARAM_INVALID = -995; // 参数无效
    const ACCESS_TOKEN_TIMEOUT = -996;
    const SESSION_TIMEOUT = -997;
    const UNKNOWN = -998;
    const EXCEPTION = -999;
    const CART_ERROR = -1000;

    //活动相关code
    const LOCK_SUBMIT = -2000;
    const ACTIVITY_OPEN_ERR = -2001;

    static public function getConstants() {
        $oClass = new \ReflectionClass(__CLASS__);
        return $oClass->getConstants();
    }

}